import request from '@/utils/request'

// 查询采购申请单列表
export function listPurchase(query) {
  return request({
    url: '/xiaocui/purchase/list',
    method: 'get',
    params: query
  })
}

// 查询采购申请单详细
export function getPurchase(procurementId) {
  return request({
    url: '/xiaocui/purchase/' + procurementId,
    method: 'get'
  })
}

// 新增采购申请单
export function addPurchase(data) {
  return request({
    url: '/xiaocui/purchase',
    method: 'post',
    data: data
  })
}

// 修改采购申请单
export function updatePurchase(data) {
  return request({
    url: '/xiaocui/purchase',
    method: 'put',
    data: data
  })
}

// 删除采购申请单
export function delPurchase(procurementId) {
  return request({
    url: '/xiaocui/purchase/' + procurementId,
    method: 'delete'
  })
}

/**
 * 所有用户信息
 * @param procurementId
 * @returns {*}
 */
export function userList() {
  return request({
    url: '/xiaocui/purchase/userList',
    method: 'post'
  })
}

/**
 * 更新采购状态,分配人员
 */

export function userUpdatePurchase(data){
  return request({
    url: '/xiaocui/purchase/userUpdatePurchase',
    method:'post',
    data:  data
  })


  // export function addPurchase(data) {
  //   return request({
  //     url: '/xiaocui/purchase',
  //     method: 'post',
  //     data: data
  //   })
  // }


}




